package com.example.springsecurity.mapper;

import com.example.springsecurity.domain.CorrectShare;
import com.example.springsecurity.domain.ExportScore;
import com.example.springsecurity.domain.ShareProject;
import com.example.springsecurity.domain.TeacherCorrectShare;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;

import java.util.List;

/**
 * @ClassName CorrectShareProjectMapper
 * @Description TODO
 * @Author lvyongwei
 * @Date 2020-10-15 17:21
 **/
@Mapper
public interface CorrectShareProjectMapper {

    /**
     * 获取用户(负责人/教师)负责的实验项目信息
     * @param userId   用户id
     * @param message  搜索条件
     * @return
     */
    public List<ShareProject> getAllShareProject(@Param("userId")Long userId,@Param("message")String message);

    /**
     * 获取未批改共享的个数
     * @param projectId
     * @return
     */
    public Integer getNoCorrectCount(Integer projectId);

    /**
     * 获取到批改列表
     * @param projectId  项目实验id
     * @param realName   学生真实姓名
     * @param correctStatus  提交状态
     * @return
     */
    public List<TeacherCorrectShare> getAllTeacherCorrectShare(@Param("projectId") Integer projectId,@Param("realName") String realName, @Param("correctStatus") Integer correctStatus);

    /**
     * 教师批改学生共享 点击批改后返回的内容
     * @param submitId
     * @return
     */
    public CorrectShare getCorrectShare(Integer submitId);

    /**
     * 教师批改共享，提交批改成绩
     * @param teacherCorrectShare
     * @return
     */
    public boolean insertCorrectShare(TeacherCorrectShare teacherCorrectShare);

    /**
     * 修改学生提交共享成绩表的状态为已批改
     * @param submitId
     * @return
     */
    public boolean updateCorrectStatus(Integer submitId);

    /**
     * 根据批改id获取批改详情
     * @param correctId
     * @return
     */
    public TeacherCorrectShare getTeacherCorrectShareById(Integer correctId);

    /**
     * 导出成绩
     * @param projectId
     * @return
     */
    public List<ExportScore> exportCorrectShare(@Param("projectId") Integer projectId);
}
